package com.jushu.storbox.util;

import android.annotation.SuppressLint;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtil {
	
	public final static String YYYY_MM_DD_1 = "yyyy/MM/dd";
	public final static String MM_DD_YYYY_1 = "MM/dd/yyyy";

	@SuppressLint("SimpleDateFormat")
	public static String getDateFormatString(long time, String format) {
		Date date = new Date(time);
		SimpleDateFormat sdf = new SimpleDateFormat(format);
		String nowTime = sdf.format(date);
		return nowTime;
	}
	
	@SuppressWarnings("deprecation")
	@SuppressLint("SimpleDateFormat")
	public static long getDayTime(long time) {
		Date date = new Date(time);
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
		String nowTime = sdf.format(date);
		return Date.parse(nowTime);
	}

}
